#include "miscellanea.h"

miscellanea::miscellanea(AnimationManager &A,int X, int Y){
    anim = A;
    x = X;
    y = Y;
    dir = 0;

    life=true;
    timer=0;
    timer_end=0;
    dx=dy=0;
}

void miscellanea::draw(sf::RenderWindow &window){
    anim.draw(window,x,y+h);
}

sf::FloatRect miscellanea::getRect(){
    return sf::FloatRect(x,y,w,h);
}

void miscellanea::option(std::string NAME, float SPEED, int HEALTH, std::string FIRST_ANIM){
    Name = NAME;
    if (FIRST_ANIM!="") anim.set(FIRST_ANIM);
    w = anim.getW();
    h = anim.getH();
    dx = SPEED;
    Health = HEALTH;
}